package cn.edu.ujn.bmis.model;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 
 * 图书基本信息类
 *
 */

@Entity
@Table(name = "book")
public class Book {

	private long bookId; // 图书编号
	private String isbn; // 国际标准书号
	private String bookName; // 图书名称
	private String bookType; // 图书类别
	private String author; // 图书作者
	private String press; // 出版社
	private double price; // 图书定价
	private Donator donator; // 捐赠者
	private String bookrack; // 存放书架
	private String donatorTime; // 捐赠时间
	private int borrowOK; // 是否可解
	private String operatorId ; // 操作员

	public Book() {

	}

	public String getAuthor() {
		return author;
	}

	@Id
	@GeneratedValue
	public long getBookId() {
		return bookId;
	}

	public String getBookName() {
		return bookName;
	}

	public String getBookrack() {
		return bookrack;
	}

	public String getBookType() {
		return bookType;
	}

	public int getBorrowOK() {
		return borrowOK;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "donatorId")
	public Donator getDonator() {
		return donator;
	}

	public String getIsbn() {
		return isbn;
	}

	public String getPress() {
		return press;
	}

	public double getPrice() {
		return price;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public void setBookId(long bookId) {
		this.bookId = bookId;
	}

	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	public void setBookrack(String bookrack) {
		this.bookrack = bookrack;
	}

	public void setBookType(String bookType) {
		this.bookType = bookType;
	}

	public void setBorrowOK(int borrowOK) {
		this.borrowOK = borrowOK;
	}

	public void setDonator(Donator donator) {
		this.donator = donator;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	public void setPress(String press) {
		this.press = press;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public String getDonatorTime() {
		return donatorTime;
	}

	public void setDonatorTime(String donatorTime) {
		this.donatorTime = donatorTime;
	}

	public String getOperatorId() {
		return operatorId;
	}

	public void setOperatorId(String operatorId) {
		this.operatorId = operatorId;
	}
}
